<?php

/*$server=new swoole\http\server("0.0.0.0",9503);

//swoole会开辟一个协程栈,对协程栈进行初始化
$server->on('request',function(){
    $swoole_mysql = new Co\MySQL();
    $swoole_mysql->connect([
        'host' => '127.0.0.1',
        'port' => 3306,
        'user' => 'root',
        'password' => 'Qq!990979940',
        'database' => 'test',
    ]);
    //收包
    $res = $swoole_mysql->query('select sleep(3)');
    var_dump($res);


});


$server->start();*/



//go函数,创建协程
go(function (){

    $swoole_mysql = new Co\MySQL();
    $swoole_mysql->connect([
        'host' => '127.0.0.1',
        'port' => 3306,
        'user' => 'root',
        'password' => 'Qq!990979940',
        'database' => 'test',
    ]);

    //收包
    $res = $swoole_mysql->query('select sleep(3)');
    var_dump($res);

});
